<?php
$config_sql=file_get_contents("../config_sql.txt");
$arr_config_sql=  explode("!",$config_sql);

$hostname= "$arr_config_sql[1]";


$username = "$arr_config_sql[2]";


$password = "$arr_config_sql[3]";




$db = mysql_connect($hostname, $username, $password) //соединение с базой данных
        or die('connect to database failed');

		
//$table_db = 'monitoring';		
$table_db=	"$arr_config_sql[4]";
mysql_select_db($table_db) or die('db not found'); 
$count=0;
//$sql = "UPDATE `monitoring`.`uzer_devise` SET `contact` = \'(093)752-1548\' WHERE `uzer_devise`.`id` = 44;";

$res = mysql_query("SELECT * FROM uzer_devise WHERE devise_name='panda' ORDER BY `id`");
		while($row = mysql_fetch_array($res)){
		$arrID[$count]=$row['id']; // выбираем все id 
		echo $arrID[$count].":";
		$count++;
		
		}

echo $count;

 for($i=0; $i<$count; $i++){                      
	
	$sql = "UPDATE `monitoring`.`uzer_devise` SET `contact` = '(093)600-0215' WHERE `uzer_devise`.`id` = $arrID[$i];"; ///меняем позывной
	//$arrEmaiUzer[$i] = explode("#",$arrUzers[$i]);
	if (!mysql_query($sql,$db))
  {
  die('Error: ' . mysql_error());
  }
  
  /* $sql = "UPDATE `monitoring`.`uzer_devise` SET `contact` = '(063)814-2823' WHERE `uzer_devise`.`id` = $arrID[$i];"; ///меняем телефон этому юзеру
	//$arrEmaiUzer[$i] = explode("#",$arrUzers[$i]);
	if (!mysql_query($sql,$db))
  {
  die('Error: ' . mysql_error());
  } */
  
  
} 

//$newuser="Maxislav";


//$sql = "DELETE FROM `uzer_devise` WHERE `devise_name`='al';"; 




mysql_close($db);


?>